package com.chukun.flink.stream.window.join.bean;

import com.chukun.flink.stream.util.TimeStampUtils;

import java.sql.Timestamp;
import java.text.ParseException;

/**
 * @author chukun
 * @version 1.0.0
 * @description 用户交易数据
 * @createTime 2022年05月26日 23:44:00
 */
public class UserTrade {

    private String userName;

    private int amount;

    private String client;

    public Timestamp tradeTime;

    public UserTrade(String userName, int amount, String client, String tradeTime) throws ParseException {
        this.userName = userName;
        this.amount = amount;
        this.client = client;
        this.tradeTime = TimeStampUtils.stringToTime(tradeTime);
    }

    public UserTrade() {}

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public String getClient() {
        return client;
    }

    public void setClient(String client) {
        this.client = client;
    }

    public Timestamp getTradeTime() {
        return tradeTime;
    }

    public void setTradeTime(Timestamp tradeTime) {
        this.tradeTime = tradeTime;
    }

    @Override
    public String toString() {
        return "UserTrade{" +
                "userName='" + userName + '\'' +
                ", amount=" + amount +
                ", client='" + client + '\'' +
                ", tradeTime=" + tradeTime +
                '}';
    }
}
